//
//  NSString+time.m
//  LHImagePicker
//
//  Created by 刘辉 lewis on 2018/6/13.
//  Copyright © 2018年 刘辉 lewis. All rights reserved.
//

#import "NSString+time.h"

@implementation NSString (time)
+(NSString*)durationFromTimerinterval:(NSTimeInterval)interval{
    NSInteger hour=interval/3600;
    NSInteger min=interval/60;
    NSInteger second=(NSInteger)interval%60;
    if (hour==0) {
        return [NSString stringWithFormat:@"%02ld:%02ld",min,second];
    }else{
        return [NSString stringWithFormat:@"%02ld:%02ld:%02ld",hour,min,second];
    }
}
@end
